<html>
    <head>
        <script type="text/javascript" src="/js/home/index.js"></script>
        <link rel="stylesheet" href="/css/home/home.css" />
        <link rel="stylesheet" href="/css/home/message.css" />
        <script type="text/javascript">
            $(function() {
                $(".btnNewMessage").button();
            });
            $(document).ready(function() {
                $( "#txtMailTo" ).autocomplete({
                    source: function(request, response) {
                        $.getJSON("/home/connectionAutocomplete", { term: request.term }, response);
                    }
                });
            })
        </script>
    </head>
    <body>
        <div class="ui-widget-content ui-corner-all" style="padding: 20px 10px; margin: 40px 0">
            <table id="" cellpadding="0" cellspacing="0" class="mainLayout">
                <div class="title-head">Messages</div>
                <tr>
                    <td align="left" class="paddingRight10 mainLeftCol">
                        <table cellpadding="0" cellspacing="0" width="100%">
                            <tr  style="height: 20px">
                                <td valign="middle" class="paddingBottom10" style="padding-left: 40px;">
                                    <div style="width: 100%;" class="uiHeaderPage">
                                        <div class="clearfix">
                                            <div class="btnNewMessage floatRight">
                                                <a href="javascript: void(0);" class="btn" onclick="return showAsDialog(400, 300, (document.documentElement.clientHeight - 300)/2, (document.documentElement.clientWidth - 400)/2, false, 'dialog');" style="height: 20px; font-size: 12px;"> New Message </a>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <?php include_component('general', 'messageList', array ('userID' => $sf_user->getAttribute('currentuser', '0')->getId())); ?>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </body>
</html>
<!--<link rel="stylesheet" href="/css/demos.css">-->
<!--<link rel="stylesheet" href="/css/themes/ui-lightness/jquery.ui.all.css">-->

<!--<link rel="stylesheet" type="text/css" href="/css/Module_Home/new.css" />-->



<div id="bodier">
    <div id="right">
        <div id="right-wrapper">
            <div id="boxes">
                <div id="dialog" class="window ui-dialog ui-widget ui-widget-content ui-corner-all">
                    <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
                        <span class="ui-dialog-title" id="ui-dialog-title-observation-form-dialog">New Message</span>
                        <a onclick="javascript:$('.window').hide()" class="ui-dialog-titlebar-close ui-corner-all clickable" role="button">
                            <span class="ui-icon ui-icon-closethick">close</span>
                        </a>
                    </div>
                    <div id="adding">
<!--                        <table>
                            <tr>
                                <td>
                                    <?php //include_partial('general/applicationMessageControl') ?>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="/images/mails.png" width="35" height="35" alt="mails"/>
                                </td>
                                <td>
                                    <h3>Send Messages to any connections</h3>
                                </td>
                            </tr>
                        </table>-->
                        
                        <form id="frmSendMessage" name="Add title" action="<?php echo url_for('home/sendMessage') ?>" method="post">
                            <table border="0" style="padding: 20px 10px 10px 10px; font-size: 90%; width: 100%">
                                <?php //echo $form; ?>
                                <tr>
                                    <td><?php echo $form['email']->renderLabel() ?></td>
                                    <td><?php echo $form['email']->render(array("class" => "required text ui-widget-content ui-corner-all")) ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo $form['subject']->renderLabel() ?></td>
                                    <td><?php echo $form['subject']->render(array("class" => "required text ui-widget-content ui-corner-all")) ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo $form['body']->renderLabel() ?></td>
                                    <td><?php echo $form['body']->render(array("class" => "required text ui-widget-content ui-corner-all")) ?></td>
                                </tr>
                                <tr><td></td></tr>
                                <tr>
                                    <td></td>
                                    <td align="right" width="">
                                        <input class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="submit" value="Send" style="width: 70px; font-size: 90%"/>
                                    </td>
                                </tr>
                            </table>
<!--                            <input onclick="LoadUserConnectionList();" type="text" name="To" id="txtMailTo" class="ui-autocomplete-input required" title="Search Connection" size="100%" />
                            <input type="text" name="Subject" title="Subject" size="100%" />
                            <textarea name="Message" rows="4" cols="10" style="width: 50%"></textarea>
                            <input type="submit" value="Send" style="width: 50px"/>
                                <button id="btnSend"> Send </button>
                                <button> Save as Draft</button>-->
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
